<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script
	src="${pageContext.request.contextPath}/resources/js/jquery-1.9.1.min.js"></script>
<script
	src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/js/housekeeper/housekeeper_select.js"></script>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/resources/css/main_font.css" />
<title>四川芝麻开门管理系统</title>
</head>
<body>
	<div class="container">
		<c:set var="housekeeper" scope="session" value="${housekeeper}" />
		<c:if test="${housekeeper==null}">
			<span><a
				href="${pageContext.request.contextPath}/pagejump/toLogin">您未登陆哦，请登陆！</a></span>
		</c:if>
		<c:if test="${housekeeper!=null}">
			<span>${sessionScope.housekeeper.name},欢迎您！<a
				href="${pageContext.request.contextPath}/pagejump/toLogin">退出登陆</a></span>
		</c:if>
	</div>
	<div class="container">
		<span><a
			href="${pageContext.request.contextPath}/pagejump/toIndex">主页</a>><a
			href="${pageContext.request.contextPath}/admin/housekeeper">管家信息管理</a>>管家信息查询，修改</span>
	</div>
	<div class="container">
		<div id="Return">
			<c:set var="response" scope="request" value="${serverResponse}" />
			<c:if test="${response.status==1}">
				<font color='red'>${response.msg}</font>
			</c:if>
		</div>
		<form action="${pageContext.request.contextPath}/housekeeper_manage/selectByOneUser" id="selectForm">
			<select onchange="select_type()" id="select_type" name="select_type">
				<!-- 下拉框选择查询属性 -->
				<option value="phone">手机号查询</option>
				<option value="name">姓名查询</option>
				<option value="identity_card">身份证查询</option>
				<option value="identity_address">身份证地址查询</option>
				<option value="housekeeper_address">办公地址查询</option>
				<option value="user_grade">管家级别查询</option>
			</select>
			<div id="select_text">
				<input type="text" id="select_input" name="select_input" autocomplete="off">
			</div>
			<!-- 输入查询信息 -->
			<div>
				<button type="button" class="btn btn-success"
					onclick="housekeeperSelect_U()">查询</button>
			</div>
		</form>
		<div class="container" id = "returnSelectList">
			<c:set var="userResponse" scope="request" value="${userResponse}" />
			<c:if test="${userResponse!=null}">
				<c:if test="${userResponse.status==1}">
					<font color='red'>${userResponse.msg}</font>
				</c:if>
				<c:if test="${userResponse.status==0}">
					<table class="table table-striped">
						<tr>
							<th>序号</th>
							<th>姓名</th>
							<th>手机</th>
							<th>管家级别</th>
							<th>办公地址</th>
							<th></th>
						</tr>
						<c:forEach var="user" varStatus="sta" items="${userResponse.data}">
							<tr>
								<td><font>${sta.count}</font></td>
								<td><font>${user.name}</font></td>
								<td>${user.phone}</td>
								<td>${user.user_grade}</td>
								<td>${user.housekeeper_address}</td>
								<td><a href="${pageContext.request.contextPath}/housekeeper_manage/select_one_housekeeper?userId=${user.id}">完整信息</a></td>
							</tr>
						</c:forEach>
					</table>
				</c:if>
			</c:if>
		</div>
	</div>
</body>
</html>